﻿namespace AzureLogProviders.Common
{
    using System;
    using System.Collections.Generic;

    using AzureLogProviders.Configuration;

    public abstract class AzureLogProvider : ProviderBase
    {
        #region Methods

        /// <summary>
        /// Ends the log grouping.
        /// </summary>
        /// <param name="guid">GUID of previous group. Guid returned by StartLogGrouping method.</param>
        public abstract void EndLogicalGrouping(Guid guid);

        /// <summary>
        /// Gets the logical group id.
        /// </summary>
        /// <returns>the logical group guid</returns>
        public abstract Guid GetLogicalGroupId();

        /// <summary>
        /// Gets the loglevel
        /// </summary>
        /// <returns>
        /// The log level.
        /// </returns>
        public abstract LogSeverityLevel GetLogLevel();

        /// <summary>
        /// Gets the tracer.
        /// </summary>
        /// <returns>The tracer</returns>
        public abstract ITracer GetTracer();

        /// <summary>
        /// Sets the severity level.
        /// </summary>
        /// <param name="severityLevel">The severity level.</param>
        public abstract void SetSeverityLevel(LogSeverityLevel severityLevel);

        /// <summary>
        /// Starts the log grouping.
        /// </summary>
        /// <param name="groupName">Name of the group.</param>
        /// <returns>GUID of previous group</returns>
        public abstract Guid StartLogicalGrouping(string groupName);

        /// <summary>
        /// Traces the log.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="severityLevel">The severity level.</param>
        public abstract void Write(object message, LogSeverityLevel severityLevel);

        /// <summary>
        /// Traces the log.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="severityLevel">The severity level.</param>
        /// <param name="exception">The exception.</param>
        public abstract void Write(object message, LogSeverityLevel severityLevel, Exception exception);

        /// <summary>
        /// Traces the log.
        /// </summary>
        /// <param name="message">
        /// The message.
        /// </param>
        /// <param name="severityLevel">
        /// The severity level.
        /// </param>
        /// <param name="exception">
        /// The exception.
        /// </param>
        /// <param name="originator">
        /// The originator.
        /// </param>
        public abstract void Write(object message, LogSeverityLevel severityLevel, Exception exception, string originator);

        /// <summary>
        /// Writes the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="severityLevel">The severity level.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="originator">The originator.</param>
        /// <param name="properties">The properties.</param>
        public abstract void Write(object message, LogSeverityLevel severityLevel, Exception exception, string originator, IDictionary<string, object> properties);

        #endregion Methods
    }
}
